package me.feng.dao.impl

import org.hibernate.Session
import me.feng.domain.Friends
import java.util.{List => JList}
import me.feng.domain.Member

class FriendsDao(session:Session) extends BaseDao(session){

  def findAll():JList[Friends]={
    val hql ="from Friends "
    session.createQuery(hql).list().asInstanceOf[JList[Friends]]
  }
  
  def getMyFrinds(uid:String):JList[Member] = {
    val hql ="select m from Friends f, Member m where f.uid=? and f.fid=m.id"
    session.createQuery(hql).setParameter(0, uid).list().asInstanceOf[JList[Member]]
  }
}